import request from "@/utils/request";

/**
 * 财务审核列表
 * @param {Object} query 查询参数
 * @returns {Promise} 请求的Promise对象
 */
export function listFinancialAudit(query) {
  return request({
    url: "/mes/sale/secAudit/list",
    method: "get",
    params: query,
  });
}

/**
 * 财审通过
 * @param {Object} data 审核数据
 * @returns {Promise} 请求的Promise对象
 */
export function auditPassFinancial(data) {
  return request({
    url: "/mes/sale/secAudit/pass",
    method: "post",
    data: data,
  });
}

/**
 * 财审驳回
 * @param {Object} data 审核数据
 * @returns {Promise} 请求的Promise对象
 */
export function auditRejectFinancial(data) {
  return request({
    url: "/mes/sale/secAudit/reject",
    method: "post",
    data: data,
  });
}

// 财审-销售订单列表
export function listFinancialAuditOrders(id) {
  return request({
    url: "/mes/sale/secAudit/orderList/" + id,
    method: "get",
  });
}

// 财审-商品明细
export function listFinancialAuditItems(id) {
  return request({
    url: "/mes/sale/secAudit/productList/" + id,
    method: "get",
  });
}

// 财审-收货信息
export function getPrepareDelivery(prepareId) {
  return request({
    url: "/mes/sale/secAudit/deliveryInfo/" + prepareId,
    method: "get",
  });
}
